import java.io.*;
import java.sql.*;
import javax.servlet.http.*;

public class CheckMail extends HttpServlet
{
  String student_name="";
	String college_code ="";
	String course="";
	String ssc=null;
	String inter="";
String graduation="";
String pg="";
String pg_year="";
String technical_skills="";
String company_name="";
String mobile="";
    @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException
  {

     try
       {
    company_name=request.getParameter("company_name");

         response.setContentType("text/html");
         PrintWriter out=response.getWriter();


        Class.forName("oracle.jdbc.driver.OracleDriver");

         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","pac","mca"); 

         Statement stmt=con.createStatement();
         
             ResultSet rs = stmt.executeQuery("SELECT *from register_job WHERE company_name='"+company_name+"'");

             
         while(rs.next())

         {
             student_name=rs.getString(1);
             college_code=rs.getString(2);
	  course=rs.getString(3);
	  ssc=rs.getString(4);
	   inter=rs.getString(5);
           graduation=rs.getString(6);
           pg=rs.getString(7);
           pg_year=rs.getString(8);
           technical_skills=rs.getString(9);
           company_name=rs.getString(11);
           mobile=rs.getString(10);
           
        }
            


        out.println("<html>");
      out.println("<body bgcolor='lightpink'>"); 
             out.println("<center>");
	
        
      out.println("<h4>student details</h4>");
     out.println("<table cellspacing='3'>");

        out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\"> Name</font> </b>");
              out.println("<td> <b> <font color=\"white\"> :"+student_name+" </font> </b>");
        out.println("</tr>");

        out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\">college_code  </font> </b>");
              out.println("<td> <b> <font color=\"white\"> :"+college_code+" </font> </b>");
        out.println("</tr>");

        out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\"> course </font> </b>");
              out.println("<td> <b> <font color=\"white\"> :"+course+" </font> </b>");
        out.println("</tr>");   
     
        out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\"> SSC Marks Percentage </font>  </b>");
              out.println("<td> <b> <font color=\"white\"> :"+ssc+" </font> </b>");
        out.println("</tr>");

        out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\">Intermediate Marks Percentage </font>  </b>");
              out.println("<td> <b> <font color=\"white\"> :"+inter+" </font> </b>");
        out.println("</tr>");

        out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\">Degree Marks Percentage  </font> </b>");
              out.println("<td> <b> <font color=\"white\"> :"+graduation+" </font> </b>");
        out.println("</tr>");

        out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\"> PG Marks Percentage </font> </b>");
              out.println("<td> <b> <font color=\"white\"> :"+pg+" </font> </b>");
        out.println("</tr>");

        out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\"> Year of Passing  </font> </b>");
              out.println("<td> <b> <font color=\"white\"> :"+pg_year+" </font> </b>");
        out.println("</tr>");
   out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\"> technical skills</font> </b>");
              out.println("<td> <b> <font color=\"white\"> :"+technical_skills+" </font> </b>");
        out.println("</tr>");
        out.println("<tr>");
              out.println(" <td> <b> <font color=\"black\"> mobile</font> </b>");
              out.println("<td> <b> <font color=\"white\"> :"+mobile+" </font> </b>");
        out.println("</tr>");
out.println("<tr>");
              
out.println("<br><br><br>");
     out.println(" </table> ");
     
     
     out.println("</body>");

     out.println("</html>");   
    
 }
         
     
 
    catch(Exception e)
       {
      
        // response.sendError(505,e.getMessage());
         e.printStackTrace();       
}   

  }

}  

 